import request from '@/utils/request'

// 对应接口的列表接口index
export function fetchProjectList(query) {
  return request({
    url: '/project/list',
    method: 'post',
    params: query
  })
}

// 对应接口的详情接口show
export function fetchProject(id) {
  return request({
    url: `/project/${id}`,
    method: 'get',
    params: {}
  })
}

// 对应接口的创建接口post create
export function createProject(data) {
  return request({
    url: '/project/addmyproject',
    method: 'post',
    data
  })
}

// 对应接口的更新接口put update
export function updateProject(data) {
  return request({
    url: `/project/editproject`,
    method: 'post',
    data
  })
}

// 对应接口的更新接口delete
export function deleteProject(data) {
  return request({
    url: `/project/delproject`,
    method: 'post',
    data
  })
}
